package Properties;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

public class test {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("java","java进阶");
        properties.setProperty("mysql","mysql数据库");
        System.out.println(properties);

        properties.store(new FileOutputStream("prt\\src\\test.properties"),"meiyou");

        Properties properties1 = new Properties();
        properties1.load(new FileInputStream("prt\\src\\test.properties"));
        System.out.println(properties1.getProperty("java"));
        System.out.println(properties1.getProperty("mysql"));
        Set<String> strings = properties1.stringPropertyNames();
        System.out.println(strings);
    }
}
